package com.itheima.article.controller;


import com.itheima.article.dto.CollectionBehaviorDto;
import com.itheima.article.pojo.ApCollection;
import com.itheima.article.service.ApCollectionService;
import com.itheima.common.pojo.Result;
import com.itheima.core.controller.AbstractCoreController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* <p>
* APP收藏信息表 控制器</p>
* @author 作者
* @since 2021-08-20
*/
@RestController
@RequestMapping("/apCollection")
public class ApCollectionController extends AbstractCoreController<ApCollection> {

    private ApCollectionService apCollectionService;

    //注入
    @Autowired
    public ApCollectionController(ApCollectionService apCollectionService) {
        super(apCollectionService);
        this.apCollectionService=apCollectionService;
    }

    /***
     * 收藏
     * @param dto
     * @return
     */
    @PostMapping("/collection")
    public Result collection(@RequestBody CollectionBehaviorDto dto){
        apCollectionService.coll(dto);
        return Result.ok();
    }

}

